import java.math.BigInteger;

import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.util.Vector;

public class Main {
	
	public static void main(String [ ] args)
	{
		long start_time;
		Kattio io = new Kattio(System.in, System.out);
		start_time = System.currentTimeMillis();
		
		while(io.hasMoreTokens()){
			String in = io.getWord();
			
			if(System.currentTimeMillis() - start_time > 14650L){
				io.println("fail");
				
			}
			else{
			
				//if(in.length() > 25){
				//	io.println("fail");
				//}
				//else{
					Vector<BigInteger> factors = new Vector<BigInteger>();
					Pollard p = new Pollard(io, System.currentTimeMillis(), factors);
					BigInteger n = new BigInteger(in);
					p.factor(n);
					
					boolean failed = false;
					for(int i=0;i<factors.size();i++){
						if(factors.get(i).compareTo(BigInteger.ONE) == 0){
							io.println("fail");
							failed = true;
							break;
						}
						//io.println(factors.get(i));
					}
					if(failed == false){
						for(int i=0;i<factors.size();i++){
							io.println(factors.get(i));
						}
					}
				//}
			}
			io.println();
			io.flush();
		}
		io.flush();
	}

}
